

package com.dog.basics.admin.controller.wishwash.api;
import com.dog.basics.bean.dto.api.wishwash.ApiDogHxDevNodeInfoDto;
import com.dog.basics.common.annotation.ApiLog4j;
import com.dog.basics.common.util.PageParam;
import com.dog.basics.common.util.R;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dog.basics.bean.dto.api.wishwash.ApiDogHxDevNodeFromDto;
import com.dog.basics.bean.vo.api.wishwash.ApiDogHxDevNodeVo;
import com.dog.basics.security.annotation.Inner;
import com.dog.basics.service.wishwash.DogHxDevNodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 设备节点信息
 *
 * @author cy code generator
 * @date 2021-07-09 17:40:26
 */
@RestController
@AllArgsConstructor
@RequestMapping("/api/hxdevnode")
@Api(value = "设备节点信息管理", tags = "API:设备节点信息管理")
public class ApiDogHxDevNodeController {

    private final DogHxDevNodeService dogHxDevNodeService;

    /**
     * @功能描述: 设备有几种挂载类型
     * @author He
     * @date 2021/7/12
     */
    @ApiLog4j
    @Inner
    @GetMapping
    @ApiOperation(value = "设备有几种挂载类型", notes = "查询设备有几种挂载设备[响应参数:0无/1洗衣机/2烘干机/3洗衣机+烘干机]")
    public R<Integer> getApiDevBdType(ApiDogHxDevNodeInfoDto dto){
        return R.ok(dogHxDevNodeService.getApiDevBdType(dto));
    }

    @ApiLog4j
    @Inner
    @GetMapping("/size")
    @ApiOperation(value = "设备挂载大小类型", notes = "设备挂载大小类型[响应参数:0超小 1小 2中 3大 4超大]")
    public R<List<Integer>> getApiDevBdTypeSize(ApiDogHxDevNodeInfoDto dto){
        return R.ok(dogHxDevNodeService.getApiDevBdTypeSize(dto));
    }
    /**
     * 洗衣烘干机设备列表
     *
     * @param page 分页对象
     * @param obj  设备节点信息
     * @return
     * @author cy code generator
     * @date 2021-07-09 17:40:26
     */
    @ApiLog4j
    @Inner
    //@EncryDecryVerification
    @ApiOperation(value = "洗衣烘干机设备列表", notes = "查询独特设备标识的洗衣烘干机子设备信息【分页查询】")
    @GetMapping("/page")
    public R<IPage<ApiDogHxDevNodeVo>> getDogHxDevNodePage(PageParam page, ApiDogHxDevNodeFromDto obj) {
        return R.ok(dogHxDevNodeService.getApiPageList(page, obj));
    }


    /**
     * @功能描述: 禁用设备节点
     * @author He
     * @date 2021/8/6
     */
    @ApiLog4j
    @Inner
    @PutMapping("/{devNodeId}")
    @ApiImplicitParam(name = "devNodeId",value = "设备标识",dataType = "Long",required = true)
    @ApiOperation(value = "禁用设备节点", notes = "禁用状态调用[启用]、启用状态调用[禁用]")
    public R<Boolean> editApiDevNodeDisable(@PathVariable Long devNodeId){
        return R.ok(dogHxDevNodeService.editApiDevNodeDisable(devNodeId));
    }



}
